/**
 * Created by yyl on 2019/13/19.
 * 自定义 多选框 组
 */
import React, { Component } from "react"
import { Radio  } from "antd"
import Immutable from "immutable"

export default class RadioGroup extends Component {
    static defaultProps = {
        data: Immutable.List(),
        onChange: () => {
        }
    };

    render() {
        let data = this.props.data;
        return (
            <Radio.Group name="checkbox" defaultValue={1} onChange={this._onChange}>
                {
                    data.map(item=>{
                        return <Radio value={item.get('value')} >{item.get('text')}</Radio>
                    })
                }
            </Radio.Group>
        )
    }

    _onChange = (e) =>{
        this.props.onChange(e.target.value)
    }

}
